﻿Imports System.Web
Imports Mysoft.Map.Data
Imports System.Configuration
Imports Mysoft.Map.Application.Security
Imports System.Data.SqlClient

Public Class ICbgl
    '''功能:    获取参与采购、并可以使用的合约规划集合
    '''参数:    a_strBUGUID     公司GUID
    '''         a_strProjGUID   项目GUID
    '''返回值:  DataTable       合约规划集合
    '''         数据库连接不成功，返回空数据集(new DataTable)
    '''创建人:  黄威
    '''创建时间:2009-12-01
    '''ADD：2010-02-01 ExecuteDate(执行计划日期)，RelativelyDay(相对计划天数)
    Public Function GetBudgetForCgPlan(ByVal a_strBUGUID As String, ByVal a_strProjGUID As String) As DataTable
        Dim strSQL As String
        Dim dtResult As DataTable
        strSQL = String.Format("SELECT Convert(varchar(40),BudgetGUID) as BudgetGUID, BudgetName, CgType, CgCategoryGUID, BudgetAmount, ExecuteDateType, CZRelativelyDay, Convert(varchar(10),CZExecuteDate,126) as CZExecuteDate, WorkGUID, Convert(varchar(10),ExecuteDate,126) as ExecuteDate FROM cb_Budget WHERE BUGUID = '{0}' AND ProjectGUID = '{1}' AND IsUseable = 1 AND IsZB = 1", a_strBUGUID, a_strProjGUID)
        Try
            dtResult = MyDB.GetDataTable(strSQL)
        Catch ex As Exception
            dtResult = New DataTable()
        End Try
        Return dtResult
    End Function
End Class
